package Example;
//一球从100米高度自由落下，每次落地后反跳回原高度的一半再落下，
//求它在第10次落地时，共经过多少米？第10次反弹多高？

import java.util.Scanner;

public class Demo10 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入第几次落地：");
        int t = scan.nextInt();
        double high = 100;
        double s = 0;
        for (int i = 1; i <= t; i++) {
            s += high+high/2;
            high = high/2;
        }
        s-=high;
        System.out.println(s);
    }
}
